<?php

namespace App\Models;

use App\Models\Base;
use Illuminate\Notifications\Notifiable;

class SiteConfig extends Base
{
    //站点配置类型
    CONST SITE_CONFIG = [
        'SITE' => 1,//站点
        'UPLOAD' => 2,//附件上传
        'SMS' => 3,//短信
    ];

    use Notifiable;

    public $table='site_config';

    public $timestamps = false;
    /**
     * The attributes that are mass assignable.
     *
     * @var array<int, string>
     */
    protected $fillable = [

    ];

    /**
     * The attributes that should be hidden for serialization.
     *
     * @var array<int, string>
     */
    protected $hidden = [

    ];

    /**
     * The attributes that should be cast.
     *
     * @var array<string, string>
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];


    /**
     * 获取详情
     */
    public static function getInfo($type, $fields = '*')
    {
        return  self::where('type',$type)->first($fields);
    }

}
